<template>
    <div>
        <el-row :gutter="15">
			<el-form ref="elForm" :model="dataForm" :rules="rules" size="medium" label-width="138px" label-position="right" :disabled="setting.readonly">
					<el-col :span="12" v-if="JudgeShow('zyzmc')">
					<el-form-item label="作业证名称" prop="zyzmc" >
						<el-input v-model="dataForm.zyzmc"  :disabled ="JudgeWrite('zyzmc')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zyzbh')">
					<el-form-item label="作业证编号" prop="zyzbh" >
						<el-input v-model="dataForm.zyzbh"  :disabled ="JudgeWrite('zyzbh')"  placeholder="系统自动生成" readonly >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqdw')">
					<el-form-item label="申请单位" prop="sqdw" >
						<el-select v-model="dataForm.sqdw"  :disabled ="JudgeWrite('sqdw')" @change="person" placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sqdwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqr')">
					<el-form-item label="申请人" prop="sqr" >
						<!-- <el-select v-model="dataForm.sqr"  :disabled ="JudgeWrite('sqr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbcjhrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select> -->
							<el-select v-model="dataForm.sqr" :disabled ="JudgeWrite('sqr')" placeholder="请选择" clearable :style='{"width":"100%"}' filterable>
								<el-option v-for="(item, index) in personAll" :key="index" :label="item.realName" :value="item.id" ></el-option>
							</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqrq')">
					<el-form-item label="申请日期" prop="sqrq" >
						<el-date-picker v-model="dataForm.sqrq"  :disabled ="JudgeWrite('sqrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('gdmc')">
					<el-form-item label="设备管理名称" prop="gdmc" >
						<el-input v-model="dataForm.gdmc"  :disabled ="JudgeWrite('gdmc')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('jz')">
					<el-form-item label="介质" prop="jz" >
						<el-input v-model="dataForm.jz"  :disabled ="JudgeWrite('jz')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('wd')">
					<el-form-item label="温度" prop="wd" >
						<el-input v-model="dataForm.wd"  :disabled ="JudgeWrite('wd')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('yl')">
					<el-form-item label="压力" prop="yl" >
						<el-input v-model="dataForm.yl"  :disabled ="JudgeWrite('yl')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('cz')">
					<el-form-item label="盲板材质" prop="cz" >
						<el-input v-model="dataForm.cz"  :disabled ="JudgeWrite('cz')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('gg')">
					<el-form-item label="盲板规格" prop="gg" >
						<el-input v-model="dataForm.gg"  :disabled ="JudgeWrite('gg')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbbh')">
					<el-form-item label="盲板编号" prop="mbbh" >
						<el-input v-model="dataForm.mbbh"  :disabled ="JudgeWrite('mbbh')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbcjhr')">
					<el-form-item label="盲板抽监护人" prop="mbcjhr" >
						<el-select v-model="dataForm.mbcjhr"  :disabled ="JudgeWrite('mbcjhr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbcjhrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbczyr')">
					<el-form-item label="盲板抽作业人" prop="mbczyr" >
						<el-select v-model="dataForm.mbczyr"  :disabled ="JudgeWrite('mbczyr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbczyrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbccsssj')">
					<el-form-item label="盲板抽实施时间" prop="mbccsssj" >
						<el-date-picker v-model="dataForm.mbccsssj"  :disabled ="JudgeWrite('mbccsssj')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydw')">
					<el-form-item label="作业单位" prop="zydw" >
						<el-select v-model="dataForm.zydw"  :disabled ="JudgeWrite('zydw')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in zydwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydwfzr')">
					<el-form-item label="作业单位负责人" prop="zydwfzr" >
						<el-select v-model="dataForm.zydwfzr"  :disabled ="JudgeWrite('zydwfzr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in zydwfzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('tszy')">
					<el-form-item label="涉及的其他特殊作业" prop="tszy" >
						<el-input v-model="dataForm.tszy"  :disabled ="JudgeWrite('tszy')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbtbzr')">
					<el-form-item label="盲板位置图编制人" prop="mbtbzr" >
						<el-select v-model="dataForm.mbtbzr"  :disabled ="JudgeWrite('mbtbzr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbtbzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('mbt')">
					<el-form-item label="盲板位置图" prop="mbt" >
						<JNPF-UploadImg v-model="mbtList"  :disabled ="JudgeWrite('mbt')"  accept="" :fileSize="2" sizeUnit="MB" :limit="9" >
						</JNPF-UploadImg>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbtbzrq')">
					<el-form-item label="盲板位置图编制日期" prop="mbtbzrq" >
						<el-date-picker v-model="dataForm.mbtbzrq"  :disabled ="JudgeWrite('mbtbzrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('aqcsqrr')">
					<el-form-item label="安全措施确认人" prop="aqcsqrr" >
						<el-select v-model="dataForm.aqcsqrr"  :disabled ="JudgeWrite('aqcsqrr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in aqcsqrrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('qtcs')">
					<el-form-item label="其他安全措施" prop="qtcs" >
						<el-input v-model="dataForm.qtcs"  :disabled ="JudgeWrite('qtcs')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('qtcsbzr')">
					<el-form-item label="编制人" prop="qtcsbzr" >
						<el-select v-model="dataForm.qtcsbzr"  :disabled ="JudgeWrite('qtcsbzr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in qtcsbzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('qtcsqrr')">
					<el-form-item label="确认人" prop="qtcsqrr" >
						<el-select v-model="dataForm.qtcsqrr"  :disabled ="JudgeWrite('qtcsqrr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in qtcsqrrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('aqjyr')">
					<el-form-item label="实施安全教育人" prop="aqjyr" >
						<el-select v-model="dataForm.aqjyr"  :disabled ="JudgeWrite('aqjyr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in aqjyrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<!--  -->
				<el-col :span="12" v-if="JudgeShow('mbdjhr')">
					<el-form-item label="盲板堵监护人" prop="mbdjhr" >
						<el-select v-model="dataForm.mbdjhr"  :disabled ="JudgeWrite('mbdjhr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbdjhrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbdzyr')">
					<el-form-item label="盲板堵作业人" prop="mbdzyr" >
						<el-select v-model="dataForm.mbdzyr"  :disabled ="JudgeWrite('mbdzyr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbdzyrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('mbdsssj')">
					<el-form-item label="盲板堵实施时间" prop="mbdsssj" >
						<el-date-picker v-model="dataForm.mbdsssj"  :disabled ="JudgeWrite('mbdsssj')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('sccjyj')">
					<el-form-item label="生产车间意见" prop="sccjyj" >
						<el-input v-model="dataForm.sccjyj"  :disabled ="JudgeWrite('sccjyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sccjqz')">
					<el-form-item label="签字" prop="sccjqz" >
						<el-select v-model="dataForm.sccjqz"  :disabled ="JudgeWrite('sccjqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sccjqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sccjrq')">
					<el-form-item label="日期" prop="sccjrq" >
						<el-date-picker v-model="dataForm.sccjrq"  :disabled ="JudgeWrite('sccjrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('spdwyj')">
					<el-form-item label="审批单位意见" prop="spdwyj" >
						<el-input v-model="dataForm.spdwyj"  :disabled ="JudgeWrite('spdwyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('spdwqz')">
					<el-form-item label="审批单位签字" prop="spdwqz" >
						<el-select v-model="dataForm.spdwqz"  :disabled ="JudgeWrite('spdwqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in spdwqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sprq')">
					<el-form-item label="审批日期" prop="sprq" >
						<el-date-picker v-model="dataForm.sprq"  :disabled ="JudgeWrite('sprq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('zydwyj')">
					<el-form-item label="作业单位意见" prop="zydwyj" >
						<el-input v-model="dataForm.zydwyj"  :disabled ="JudgeWrite('zydwyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydwqz')">
					<el-form-item label="作业单位意见签字" prop="zydwqz" >
						<el-select v-model="dataForm.zydwqz"  :disabled ="JudgeWrite('zydwqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in zydwqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydwrq')">
					<el-form-item label="作业单位意见签字" prop="zydwrq" >
						<el-date-picker v-model="dataForm.zydwrq"  :disabled ="JudgeWrite('zydwrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('mbcdzydwqk')">
					<el-form-item label="作业单位确认情况" prop="mbcdzydwqk" >
						<el-input v-model="dataForm.mbcdzydwqk"  :disabled ="JudgeWrite('mbcdzydwqk')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbcdzydwqz')">
					<el-form-item label="签字" prop="mbcdzydwqz" >
						<el-select v-model="dataForm.mbcdzydwqz"  :disabled ="JudgeWrite('mbcdzydwqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in mbcdzydwqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('mbcdzydwrq')">
					<el-form-item label="日期" prop="mbcdzydwrq" >
						<el-date-picker v-model="dataForm.mbcdzydwrq"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('sccjqrqk')">
					<el-form-item label="生产车间确认情况" prop="sccjqrqk" >
						<el-input v-model="dataForm.sccjqrqk"  :disabled ="JudgeWrite('sccjqrqk')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sccjqrqz')">
					<el-form-item label="签字" prop="sccjqrqz" >
						<el-select v-model="dataForm.sccjqrqz"  :disabled ="JudgeWrite('sccjqrqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sccjqrqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sccjqrrq')">
					<el-form-item label="日期" prop="sccjqrrq" >
						<el-date-picker v-model="dataForm.sccjqrrq"  :disabled ="JudgeWrite('sccjqrrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
			</el-form>

        </el-row>
        <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
    </div>
</template>
<script>
    import request from '@/utils/request'
    import { previewDataInterface } from '@/api/systemData/dataInterface'
    import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
    import {departmentPerson}from '@/api/systemIntegration/recard'

    export default {
        components: {},
        props: [],
        data() {
            return {
							personAll:[], // 申请人
                visible: false,
                setting: {},
                eventType: '',
                userBoxVisible: false,
                dataForm: {
                    id:'',                    
					flowId: '',
					actionType:1,
					freeApproverUserId: '',
					zyzmc:undefined,
					zyzbh:undefined,
					sqdw:undefined,
					sqr:undefined,
					sqrq:undefined,
					gdmc:undefined,
					jz:undefined,
					wd:undefined,
					yl:undefined,
					cz:undefined,
					gg:undefined,
					mbbh:undefined,
					mbcjhr:undefined,
					mbczyr:undefined,
					mbccsssj:undefined,
					zydw:undefined,
					zydwfzr:undefined,
					tszy:undefined,
					mbtbzr:undefined,
					mbt:[],
					mbtbzrq:undefined,
					aqcsqrr:undefined,
					qtcs:undefined,
					qtcsbzr:undefined,
					qtcsqrr:undefined,
					aqjyr:undefined,
					sccjyj:undefined,
					sccjqz:undefined,
					sccjrq:undefined,
					spdwyj:undefined,
					spdwqz:undefined,
					sprq:undefined,
					zydwyj:undefined,
					zydwqz:undefined,
					zydwrq:undefined,
					mbcdzydwqk:undefined,
					mbcdzydwqz:undefined,
					mbcdzydwrq:undefined,
					sccjqrqk:undefined,
					sccjqrqz:undefined,
					sccjqrrq:undefined,
					mbdjhr:undefined,
					mbdzyr:undefined,
					mbdsssj:undefined,

                },
                rules: {

                },
				sqdwOptions:[],
				mbcjhrOptions:[],
				mbczyrOptions:[],
				zydwOptions:[],
				zydwfzrOptions:[],
				mbtbzrOptions:[],
				aqcsqrrOptions:[],
				qtcsbzrOptions:[],
				qtcsqrrOptions:[],
				aqjyrOptions:[],
				sccjqzOptions:[],
				spdwqzOptions:[],
				zydwqzOptions:[],
				mbcdzydwqzOptions:[],
				sccjqrqzOptions:[],
				mbdjhrOptions:[],
				mbdzyrOptions:[],

					mbtList:[],

            }
        },
        computed: {},
        watch: {},
        created() {
		this.getsqdwOptions();
		this.getmbcjhrOptions();
		this.getmbczyrOptions();
		this.getzydwOptions();
		this.getzydwfzrOptions();
		this.getmbtbzrOptions();
		this.getaqcsqrrOptions();
		this.getqtcsbzrOptions();
		this.getqtcsqrrOptions();
		this.getaqjyrOptions();
		this.getsccjqzOptions();
		this.getspdwqzOptions();
		this.getzydwqzOptions();
		this.getmbcdzydwqzOptions();
		this.getsccjqrqzOptions();
		this.getmbdjhrOptions();
		this.getmbdzyrOptions();

        },
        mounted() {
					this.mbcdzyz()
				 },
        methods: {
		getsqdwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.sqdwOptions = res.data
			})
		},
		getmbcjhrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.mbcjhrOptions = res.data
			})
		},
		getmbczyrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.mbczyrOptions = res.data
			})
		},
		getzydwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.zydwOptions = res.data
			})
		},
		getzydwfzrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.zydwfzrOptions = res.data
			})
		},
		getmbtbzrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.mbtbzrOptions = res.data
			})
		},
		getaqcsqrrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.aqcsqrrOptions = res.data
			})
		},
		getqtcsbzrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.qtcsbzrOptions = res.data
			})
		},
		getqtcsqrrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.qtcsqrrOptions = res.data
			})
		},
		getaqjyrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.aqjyrOptions = res.data
			})
		},
		getsccjqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.sccjqzOptions = res.data
			})
		},
		getspdwqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.spdwqzOptions = res.data
			})
		},
		getzydwqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.zydwqzOptions = res.data
			})
		},
		getmbcdzydwqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.mbcdzydwqzOptions = res.data
			})
		},
		getsccjqrqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.sccjqrqzOptions = res.data
			})
		},
		getmbdjhrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.mbdjhrOptions = res.data
			})
		},
		getmbdzyrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.mbdzyrOptions = res.data
			})
		},

            goBack() {
                this.$emit('refresh')
            },
						// 申请人
						async person(id) {
							this.dataForm.sqr = ''
							const {data} = await departmentPerson({organizeId:id})
							this.personAll = data.list
						},
						// 申请单位
						fullName(val,id) {
							this.person(id)
							this.val = val
							this.dataForm.sqdw = val
						},
						// 数据回填申请单位
						mbcdzyz() {
              let fullName = this.$store.getters.itemData.fullName   
							// 申请单位
							switch (fullName) {
                case '禄口油库盲板抽堵作业证':
                  return this.fullName('禄口油库','0e7420aab60f4d1d9297be06258760e9')
								break;
								case '航空加油站盲板抽堵作业证':
									return this.fullName('航空加油站','aa579f18def44c298497c7a9727fcf76')
								break;
								case '管道中心盲板抽堵作业证':
									return this.fullName('管道中心','0f3b5731aa2f4542a0b143e858c59b66')
								break;
								case '机坪车辆加油站盲板抽堵作业证':
									return this.fullName('机坪车辆加油站','3094a0f6f74d470e9b95dcc406bfcb0f')
								break;
							}
						},
            init(data) {
                this.loading = true
                this.dataForm.id = data.id || ''
                this.setting = data
                this.visible = true;
                this.$nextTick(() => {
                    this.$refs['elForm'].resetFields();
                    if (this.dataForm.id) {
                        request({
                            url: '/api/WorkFlowForm/qyaqscMbdcxx/' + this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataForm = res.data
			                    	this.mbtList = this.dataForm.mbt ? JSON.parse(this.dataForm.mbt) : [];
														this.dataForm.sqdw = this.val
                        })
                    } else {
											this.dataForm.flowId = data.flowId
											this.dataForm.sqdw = this.val
                    }
                    this.loading = false
                })
            },
            // 表单提交
            dataFormSubmit(eventType) {            
				this.$set(this.dataForm, 'mbt', JSON.stringify(this.mbtList));

                this.$refs['elForm'].validate((valid) => {
                    if (valid) {
                        if (eventType === 'audit' || eventType === 'reject') {
                            this.$emit('approval', this.dataForm, eventType)
                            return
                         }
                        this.dataForm.actionType = eventType === 'submit' ? 0 : 1
                        this.eventType = eventType
                        if (this.eventType === 'submit') {
                            if (this.setting.freeApprover == 0) {
                                this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
                                    type: 'warning'
                                }).then(() => {
                                    this.submit()
                                }).catch(() => { });
                            } else {
                                this.userBoxVisible = true
                                this.$nextTick(() => {
                                    this.$refs.userBox.init()
                                })
                            }
                        } else {
                            this.request()
                        }
                    }
                })
            },
            submit(freeApproverUserId) {
                if (freeApproverUserId) this.dataForm.freeApproverUserId = freeApproverUserId
                this.request()
            },
            request() {
                if (!this.dataForm.id) {
                    delete (this.dataForm.id)
                    request({
                        url: '/api/WorkFlowForm/qyaqscMbdcxx',
                        method: 'post',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                } else {
                    request({
                        url: '/api/WorkFlowForm/qyaqscMbdcxx/' + this.dataForm.id,
                        method: 'PUT',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                }
            },
            JudgeShow(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return true
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return item.read
            },
            JudgeWrite(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return false
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return !item.write
            },

        },
    }

</script>
